package mmc.networking.data;

import java.io.IOException;

import mmc.EngineObject;
import mmc.objects.RemotePlayer;
import mmc.server.Player;

@SuppressWarnings("serial")
public class ObjectUpdate extends Update{
	public EngineObject o;

	public ObjectUpdate(EngineObject o) {
		if(o instanceof Player){
			this.o = new RemotePlayer((Player) o);
		}else
			this.o = o;
	}

	private void writeObject(java.io.ObjectOutputStream out) throws IOException{
		out.writeUnshared(o);
	}
 
	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException{
		o = (EngineObject) in.readObject();
	}
}
